#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
char map[14] = "0123456789JQK";
int main()
{
    char a[101] = {0}, b[101] = {0};
    scanf("%s%s", a, b);
    int lena, lenb;
    lena = strlen(a);
    lenb = strlen(b);
    reverse(a, a + lena);
    reverse(b, b + lenb);
    int i;
    int minlen = lena < lenb ? lena : lenb;
    int tmp;
    for (i = 0; i < minlen; ++i)
    {//数组下标从零开始，故奇数位与题中描述相反
        if (0 == i % 2) //奇数位
        {
            b[i] = map[(a[i] + b[i] - '0' * 2) % 13];
        }
        else
        {
            tmp = b[i] - a[i];
            if (tmp >= 0)
            {
                b[i] = tmp + '0';
            }
            else
            {
                b[i] = tmp + 10 + '0';
            }
        }
    }
    reverse(b, b + lenb);
    printf("%s\n", b);
    return 0;
}